from typing import Generic, TypeVar, Optional

from pydantic import BaseModel, Field

T = TypeVar("T")


class R(BaseModel, Generic[T]):
    code: int = Field(default=200, title="业务状态码")
    msg: str = Field(default="success", title="状态信息")
    data: Optional[T] = Field(default=None, title="业务数据")
